<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=div, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box{
            width: 300px;
            height: 300px;
            border: 1px black solid;
            margin: 20px auto;
            display: flex;
            flex-direction: row;/* 主轴方向 */
            justify-content: space-around;/* 主轴（横)排列方式 */
            align-items: center;/* 侧轴(竖轴）一行子项对齐方式 */
            align-content: center;/* 多行排列方式 */
        }
        #box div{
            width: 50px;
            color: hotpink;
            line-height: 50px;
            text-align: center;
            background-color: aquamarine;
        }
    </style>
</head>
<body>
    <div id="box">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
    </div>
</body>
</html>